<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"></c:set>
<jsp:include page="../inc.jsp"></jsp:include>   
<!DOCTYPE html> 
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
</head>
<body>
	<form id="dataForm">
		<table border="1">
			<tr style="border:1px solid bule;">
				<td width="80px" align="right">旧密码</td>
				<td>
					<input type="password" 
					class="easyui-textbox" name="password" style="width:200px;height: 30px;line-height: 28px"/>
				</td>
			<tr>
			<tr>
				<td>新密码</td>
				<td>
					<input type="password" 
					class="easyui-textbox" name="newPwd" style="width:200px;height: 30px;line-height: 28px"/>
				</td>
			<tr>
			<tr>
				<td>确认密码</td>
				<td>
					<input type="password" 
					class="easyui-textbox" name="confirmPwd" style="width:200px;height: 30px;line-height: 28px"/>
				</td>
			<tr>
			<tr>
				<td>手机号码</td>
				<td>
					<input type="text" 
					class="easyui-textbox" id="moblie" value="${eu.mobile }" style="width:200px;height: 30px;line-height: 28px" readonly name="moblie"/>
				</td>
			<tr>
			<tr>
				<td>验证码</td>
				<td>
					<input type="text" 
					class="easyui-textbox" name="code" style="width:120px;height: 30px;line-height: 28px"/>
					<input style="padding-top: 5px" type="button" value="发送验证码" id="btn1"/>
				</td>
			<tr>
		</table>
	</form>
	<script type="text/javascript">
		$(function(){
			$('#btn1').click(function(){
				sendCode();
				
			});
		});	
	
		function sendCode(){
			var time = 5;
			var t;
			var mobile = $('#moblie').val();
			var url = '${ctx}/sys/sms/'+mobile;
			var data = null;
			var r = submitData(url,data);
			alert(r.msg);
			t = setInterval(function(){
				$('#btn1').attr('disabled',true);
				$('#btn1').val(time+'后重新获取');
				time--;
				if(time<0){
					clearInterval(t);
					$('#btn1').attr('disabled',false);
					$('#btn1').val('发送验证码');
				}
			},1000);
		}
	
	
	
	</script>
</body>
</html>